package com.vsen.lpr.task;

import com.vsen.lpr.common.utils.DateTimeUtil;
import com.vsen.lpr.entity.TaskPlan;
import com.vsen.lpr.mapper.TaskPlanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;

import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.DelayQueue;

/**
 * @author jaxons.he
 * @date 2021/8/22  3:15 下午
 * @description:
 */

@Component
public class TaskUtil {
    //定义队列
    public static final DelayQueue<DelayTask> queue = new DelayQueue();
    //添加任务方法
    public static void add(TaskPlan o) {
        queue.offer(DelayTask.buildTask(o));
    }

}
